package com.cskaoyan.shopping.converter;

import com.cskaoyan.shopping.dal.entitys.Item;
import com.cskaoyan.shopping.dto.TestProductDetailDto;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

@Mapper(componentModel = "spring")
public interface TestProductConverter {

    @Mapping(source = "title", target = "productName")
    // 调用get set方法
    @Mapping(source = "image", target = "imgUrl")
    //  Item -> TestProductDetailDto
    //  属性名images ——> getImages()
    // @Mapping(source = "images", target = "xxxx")
    // @Mapping(source = "imageBig", target = "xxxx")
    TestProductDetailDto itemDoToDto(Item item);
}
